diff options
| author | zwlucas <lucas.fariamo08@gmail.com> | 2026-05-29 20:21:48 +0000 |
|---|---|---|
| committer | zwlucas <lucas.fariamo08@gmail.com> | 2026-05-29 20:21:48 +0000 |
| commit | d186a989b6808ff39fcd43a9f0b478aebc4aa346 (patch) | |
| tree | abf32684ea56e6066d8584e0378227ffc397ace2 /frontend/src/routes/status/[id]/+page.ts | |
| parent | 6cc0bfd1d79074df790272b8091b1f0226d14283 (diff) | |
| download | yaum-d186a989b6808ff39fcd43a9f0b478aebc4aa346.tar.gz yaum-d186a989b6808ff39fcd43a9f0b478aebc4aa346.zip | |
feat: enhance maintenance management and heartbeat history features
- Updated Store interface to include methods for managing maintenances.
- Modified API functions to support pagination for heartbeat history and added CRUD operations for maintenances.
- Enhanced types to include paginated responses and initial log entries.
- Implemented maintenance management UI in the admin panel with create, edit, and delete functionalities.
- Updated service detail page to display paginated heartbeat history and improved chart rendering.
- Refactored status page to accommodate new data structures and ensure consistent data handling.
Signed-off-by: Lucas Faria Mendes <lucas.fariamo08@gmail.com>
Diffstat (limited to 'frontend/src/routes/status/[id]/+page.ts')
| -rw-r--r-- | frontend/src/routes/status/[id]/+page.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/frontend/src/routes/status/[id]/+page.ts b/frontend/src/routes/status/[id]/+page.ts index 4351aae..1b91c67 100644 --- a/frontend/src/routes/status/[id]/+page.ts +++ b/frontend/src/routes/status/[id]/+page.ts @@ -11,7 +11,8 @@ export const load: PageLoad = async ({ params, fetch }) => { const services = servicesRes?.ok ? await servicesRes.json() : []; const svc = services.find((s: any) => s.id === Number(id)); - const history = historyRes?.ok ? await historyRes.json() : []; + const historyJson = historyRes?.ok ? await historyRes.json() : []; + const history = Array.isArray(historyJson) ? historyJson : (historyJson.data ?? []); const stats = statsRes?.ok ? await statsRes.json() : null; return { |